<?php namespace app\home\controller;

class Listpid extends Marster{
    //动作
    public function index($pid){
        $article_catgory=Db::table('article')->join('category','cid','=','category_cid')->limit(4)->get(['ctitle','aid','cid','cname','thumb']);
//        p($article_catgory);die;
        View::with('article_catgory',$article_catgory);

        $ctitle=Db::table('article')->orderBy('sendtime','DESC')->orderBy('aid','ASC')->limit(4)->get(['ctitle','sendtime','aid']);
//        p($ctitle);die;
        View::with('ctitle',$ctitle);

        $category=Db::table('article')
            ->join('article_tag','article_aid','=','aid')
            ->join('category','cid','=','category_cid')
            ->where('tag_tid',$pid)
            ->get();
        View::with('category',$category);
    return view();
    }
}
